package com.mycompany;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Main {
    public static void main(String[] args) {
        try (AnnotationConfigApplicationContext context =
                     new AnnotationConfigApplicationContext(AppConfig.class)) {
            // 打印所有Bean名称
            for (String beanName : context.getBeanDefinitionNames()) {
                System.out.println("Bean名称：" + beanName + "，类型：" + context.getBean(beanName).getClass().getName());
            }
            TimeTaskService taskService = context.getBean(TimeTaskService.class);
            taskService.startCountdownTask();

            try {
                Thread.sleep(62000);
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
            }
        }
    }
}